package com.wc.alorithm_blue_bridge._模拟.钟表;

/**
 * @Author congge
 * @Date 2024/5/13 17:33
 * @description https://www.lanqiao.cn/problems/2188/learning/
 */
public class Main {
    static double eps = 1e-10;

    /**
     * 思路：
     * 秒钟 1s 6°
     * 分钟 1s 6° / 60
     * 时钟 1s 30° / 3600
     */
    public static void main(String[] args) {
        for (int h = 0; h <= 6; h++) {
            for (int m = 0; m < 60; m++) {
                for (int s = 0; s < 60; s++) {

                    double ss = s * 6;
                    double mm = (double) (m * 60 + s) * 6 / 60;
                    double hh = (h * 3600 + m * 60 + s) * 30.0 / 3600;
                    double A = Math.abs(mm - hh), B = Math.abs(mm - ss);
                    A = Math.min(A, 360 - A);
                    B = Math.min(B, 360 - B);
                    if (Math.abs(A - 2 * B) <= eps) {
                        System.out.println(h + " " + m + " " + s);
                    }
                }
            }
        }
    }
}